package com.yxh.www.author.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * <p>
 *  SwaggerConfiguration
 * </p>
 *
 * @author yangxiaohui
 * @since 2020/5/18
 */
@Configuration
public class SwaggerConfiguration {
    @Bean
    public Docket groupRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(this.groupApiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.hzqx.www.author.controller"))
                .paths(PathSelectors.any())
                .build();
    }
    private ApiInfo groupApiInfo(){
        return new ApiInfoBuilder()
                .title("渠道发布服务网关API")
                .description("渠道发布服务网关 RESTful APIs")
                .termsOfServiceUrl("#")
                .version("1.0")
                .build();
    }
}
